/////////////////////////////////////////////////////////////////////////////
// Name:        RemovePkgDialog.h
// Purpose:     
// Author:      yospaly
// Modified by: 
// Created:     14/01/2009 17:26:40
// RCS-ID:      
// Copyright:   Copyright (C) 2008, yospaly
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#ifndef _REMOVEPKGDIALOG_H_
#define _REMOVEPKGDIALOG_H_


/*!
 * Includes
 */

////@begin includes
////@end includes

/*!
 * Forward declarations
 */

////@begin forward declarations
////@end forward declarations

/*!
 * Control identifiers
 */

////@begin control identifiers
#define ID_MAINTAIN_PKG_DIALOG 10041
#define ID_DETAILS_TEXTCTRL 10042
#define ID_PROGRESS_GAUGE 10043
#define SYMBOL_MAINTAINPKGDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
#define SYMBOL_MAINTAINPKGDIALOG_TITLE _("Maintain packages")
#define SYMBOL_MAINTAINPKGDIALOG_IDNAME ID_MAINTAIN_PKG_DIALOG
#define SYMBOL_MAINTAINPKGDIALOG_SIZE wxSize(400, 300)
#define SYMBOL_MAINTAINPKGDIALOG_POSITION wxDefaultPosition
////@end control identifiers


/*!
 * MaintainPkgDialog class declaration
 */

class MaintainPkgDialog: public wxDialog
{    
    DECLARE_DYNAMIC_CLASS( MaintainPkgDialog )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    MaintainPkgDialog();
    MaintainPkgDialog( wxWindow* parent, wxWindowID id = SYMBOL_MAINTAINPKGDIALOG_IDNAME, const wxString& caption = SYMBOL_MAINTAINPKGDIALOG_TITLE, const wxPoint& pos = SYMBOL_MAINTAINPKGDIALOG_POSITION, const wxSize& size = SYMBOL_MAINTAINPKGDIALOG_SIZE, long style = SYMBOL_MAINTAINPKGDIALOG_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_MAINTAINPKGDIALOG_IDNAME, const wxString& caption = SYMBOL_MAINTAINPKGDIALOG_TITLE, const wxPoint& pos = SYMBOL_MAINTAINPKGDIALOG_POSITION, const wxSize& size = SYMBOL_MAINTAINPKGDIALOG_SIZE, long style = SYMBOL_MAINTAINPKGDIALOG_STYLE );

    /// Destructor
    ~MaintainPkgDialog();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

////@begin MaintainPkgDialog event handler declarations

////@end MaintainPkgDialog event handler declarations

////@begin MaintainPkgDialog member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end MaintainPkgDialog member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin MaintainPkgDialog member variables
    wxTextCtrl* p_details_textctrl;
    wxStaticText* p_maintain_status_static;
    wxGauge* p_progress_gauge;
    wxButton* p_ok_button;
    wxButton* p_cancel_button;
////@end MaintainPkgDialog member variables
public:
	void OnPkgRemoveBegin(wxCommandEvent &event);
	void OnPkgRemoving(wxCommandEvent &event);
	void OnPkgRemoveCompleted(wxCommandEvent &event);
	void OnPkgsRemoveBegin(wxCommandEvent &event);
	void OnPkgsRemoveCompleted(wxCommandEvent &event);

	void OnPkgInstallBegin(wxCommandEvent &event);
	void OnPkgInstalling(wxCommandEvent &event);
	void OnPkgInstallCompleted(wxCommandEvent &event);
	void OnPkgsInstallBegin(wxCommandEvent &event);
	void OnPkgsInstallCompleted(wxCommandEvent &event);
	
	void OnRunPreremoveScript(wxCommandEvent &event);
	void OnRunPostinstallScript(wxCommandEvent &event);
	
	void OnPkgsMaintainBegin(wxCommandEvent &event);
	void OnPkgsMaintainCompleted(wxCommandEvent &event);
	
protected:
	void _run_script(const wxString& pkg, int err, bool postinstall);
};

#endif
    // _REMOVEPKGDIALOG_H_
